package com.tianji.promotion.service;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.promotion.domain.po.Coupon;
import com.tianji.promotion.domain.po.ExchangeCode;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tianji.promotion.domain.query.CodeQuery;

/**
 * <p>
 * 兑换码 服务类
 * </p>
 *
 * @author zhongweiwei
 * @since 2023-06-03
 */
public interface IExchangeCodeService extends IService<ExchangeCode> {
    /**
     * 生成兑换码
     * @param coupon
     */
    void generateCode(Coupon coupon);

    /**
     * 分页条件查询兑换码
     * @param query
     * @return
     */
    PageDTO<ExchangeCode> queryPageCode(CodeQuery query);

    /**
     * 校验兑换码是否被兑换过
     * @param serialNum
     * @param b
     * @return
     */
    boolean updateExchangeMark(long serialNum, boolean b);
}
